from building import *

cwd = GetCurrentDir()
CPPPATH = [cwd]

src = []

if GetDepend('SUPPORT_FLASH_ASM32'):
    src += Glob('Flash_ASM32.c') 
elif GetDepend('SUPPORT_FLASH_HC32M4'):
    src += Glob('Flash_HC32M4.c') 
elif GetDepend('SUPPORT_FLASH_HC32M0P'):
    src += Glob('SUPPORT_FLASH_HC32.c') 
elif GetDepend('SUPPORT_FLASH_MN32F0'):
    src += Glob('Flash_MN32F0.c') 
elif GetDepend('SUPPORT_FLASH_SC95F861x'):
    src += Glob('Flash_SC95F861x.c')  
elif GetDepend('SUPPORT_FLASH_STM32F4X'):
    src += Glob('Flash_STM32F4x.c') 
elif GetDepend('SUPPORT_FLASH_STM32F10X'):
    src += Glob('Flash_STM32F10x.c') 
elif GetDepend('SUPPORT_FLASH_STM32G0XX'):
    src += Glob('Flash_STM32G0xx.c') 
elif GetDepend('SUPPORT_FLASH_SWM341'):
    src += Glob('Flash_SWM341.c')  
elif GetDepend('SUPPORT_FLASH_SFUD'):
    src += Glob('Flash_sfud.c')  

if GetDepend('SUPPORT_FLASH_25Q'):
    src += Glob('Flash_25Q.c') 

if GetDepend('FLASH_SD_SPI'):
    src += Glob('FlashSd_Spi.c') 

#增加SUPPORT_EX_PREINCLUDE定义以预包含Preinclude.h
predefine = ['SUPPORT_EX_PREINCLUDE']
group = DefineGroup('flash', src, depend = [''], CPPPATH=CPPPATH, CPPDEFINES = predefine)
Return('group')
